<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.thymeleaf.org/thymeleaf-extras-shiro">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
  <h1>首页</h1>
  <p th:text="${msg}"></p>
  <hr>
  <div shiro:guest="">  <!--当用户未认证，显示登录标签-->
      <a th:href="@{/tologin}">登录</a>
  </div>

  <div shiro:hasPermission="add">
      <a th:href="@{/user/add}">add</a>
  </div>
  <div shiro:hasPermission="update">
      <a th:href="@{/user/update}">update</a>
  </div>
  <hr>
  <div shiro:user="">  <!--当用户未认证，不显示登出标签-->
      <a th:href="@{/logout}">登出</a>
  </div>
  <div shiro:user="">  <!--当用户未认证，不显示锁屏标签-->
      <a th:href="@{/lock}">
          锁屏
      </a>
  </div>

  <!-- 全局js -->
  <script th:inline="javascript"> var ctx = [[@{/}]]; var lockscreen = [[${session.lockscreen}]]; if(lockscreen){window.top.location="lock.html";} </script>

  <script src="../static/js/jquery.min.js" th:src="@{../js/jquery.min.js}"></script>
  <script src="../static/js/bootstrap.min.js" th:src="@{../js/bootstrap.min.js}"></script>


</body>
</html>